package com.godyao.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Exchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author godyao
 * @date 2022/3/18
 */
@Configuration
public class RabbitMqConfig {

    @Bean
    public Queue myQueue() {
        return new Queue("secKillQueue");
    }

    @Bean
    public Exchange myExchange() {
        return new DirectExchange("secKillEx", false, false, null);
    }

    @Bean
    public Binding myBinding() {
        return new Binding("secKillQueue", Binding.DestinationType.QUEUE, "secKillEx", "direct.biz.secKill", null);
    }


}
